//
//  FistViewController.m
//  TaoBaoOne
//
//  Created by apple on 16/7/9.
//  Copyright © 2016年 shengzhengjiguan. All rights reserved.
//

#import "FistViewController.h"
#import "OneViewController.h"
@interface FistViewController ()

@end

@implementation FistViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor colorWithRed:229.0/255.0f green:128.0/225.0f blue:112.0/255.0f alpha:0.5];
    
    [self initView];
    
}
-(void)initView
{
    UILabel *titview=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 58, 40)];
    titview.text=@"首页";
    titview.textColor=[UIColor blueColor];
    titview.textAlignment=NSTextAlignmentCenter;
    UIGraphicsBeginImageContext(titview.bounds.size);
    UIBezierPath *patch=[UIBezierPath bezierPathWithRoundedRect:titview.frame byRoundingCorners: UIRectCornerTopLeft |     UIRectCornerTopRight
    cornerRadii:CGSizeMake(10, 5)];
    [[UIColor redColor]setStroke];
    [patch setLineWidth:3];
    [patch stroke];
    UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    UIImageView *imageView=[[UIImageView alloc]initWithImage:image];
    [titview addSubview:imageView];
    self.navigationItem.titleView=titview;
    [self returnOneViewCount];
    
}
-(void)returnOneViewCount
{
    UIBarButtonItem *leftButton=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemReply target:self action:@selector(returnOneVC)];
    self.navigationItem.leftBarButtonItem=leftButton;
    
}
-(void)returnOneVC
{
    OneViewController *oneVC=[[OneViewController alloc]initWithNibName:@"OneViewController" bundle:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
